import request from '@/utils/request'

// 查询智能电列列表
export function getDeviceList(query) {
  return request({
    url: '/device/list',
    method: 'get',
    params: query
  })
}

// 查询智能电列详细
export function getDevice(id) {
  return request({
    url: '/device/' + id,
    method: 'get'
  })
}

// 新增智能电列
export function addDevice(data) {
  return request({
    url: '/device/add',
    method: 'post',
    data: data
  })
}

// 修改智能电列
export function updateDevice(data) {
  return request({
    url: '/device/edit',
    method: 'put',
    data: data
  })
}

// 删除智能电列
export function delDevice(id) {
  return request({
    url: '/device/' + id,
    method: 'delete'
  })
}

// 导出智能电列
export function exportDevice(query) {
  return request({
    url: '/device/export',
    method: 'get',
    params: query
  })
}

// 通过dtuid查询设备列表
export function dtuByDevice(query) {
  return request({
    url: '/device/dtuByDevice',
    method: 'get',
    params: query
  })
}

// 获取抄表记录
export function selectRecord(query) {
  return request({
    url: '/device/selectRecord',
    method: 'get',
    params: query
  })
}

//系统开合闸
export function brake(query) {
  return request({
    url: '/device/brake',
    method: 'post',
    data: query
  })
}
//抄表
export function copyTable(id) {
  return request({
    url: '/device/copyTable/'+id,
    method: 'post'
  })
}
//查询单个拉合闸记录列表
export function closingList(query) {
  return request({
    url: '/device/valveLog',
    method: 'get',
    params: query
  })
}
//查询全部设备拉合闸记录列表
export function AllClosingList(query) {
  return request({
    url: '/device/valve/list',
    method: 'get',
    params: query
  })
}
//查询全部设备抄记录列表
export function AllRecordList(query) {
  return request({
    url: '/device/transcribe/list',
    method: 'get',
    params: query
  })
}

// 删除抄记录列表数据
export function transcribe(id) {
  return request({
    url: '/device/transcribe/' + id,
    method: 'delete'
  })
}
// 导出抄记录列表
export function exportRecords(query) {
  return request({
    url: '/device/transcribe/export',
    method: 'get',
    params: query
  })
}

// 删除拉合闸列表数据
export function deleteSwitch(id) {
  return request({
    url: '/device/valve/' + id,
    method: 'delete'
  })
}
// 导出拉合闸列表
export function exportSwitch(query) {
  return request({
    url: '/device/valve/export',
    method: 'get',
    params: query
  })
}
